home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1660 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  982 b 

  1. Path: damage.usa1.net!news
  2. From: Kin Chan <firstian@usa1.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Random numbers
  5. Date: Thu, 11 Jan 1996 23:27:51 -0500
  6. Organization: USAinternet, Inc.
  7. Message-ID: <30F5E347.5CCD@usa1.com>
  8. References: <4cul2d$gi@news.ran.es>
  9. NNTP-Posting-Host: wmn1-158.usa1.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b4 (Macintosh; I; PPC)
  14.  
  15. In order to know the period of the rand() you need to know the 
  16. numbers chosen to implement the linear congruential method. 
  17. Typically, the rand() from compilers are pretty bad if you want 
  18. about a 1 million random numbers. For a random number generator that 
  19. has a short period, even if you do not deplete all the numbers it 
  20. generates, the sequence of numbers that appear may have some special 
  21. correlation. Probably the best bet is to check out Numerical Recipes 
  22. for C, 2nd Ed. (There is a bug in one of the random number code in 
  23. the 1st Ed).
  24.